//新增模态框
function addMap(){
	$.ajax({
	    url:"/zhgl-jzstyxx-manage/application/checkCode",
	    type: 'post',
	    dataType: 'json',
	    success: function (data) {
			var tpl = document.getElementById('myFormTemplate').innerHTML;
			var html = template(tpl, {app: data});
			$("#myform").html(html);
			var tpl2 = document.getElementById('appTypeTemplate').innerHTML;
			var html2 = template(tpl2, {app:appType,list:""});
			$("select[name='appType']").html(html2);
			var tpl3 = document.getElementById('internetTypeTemplate').innerHTML;
			var html3 = template(tpl3, {app:internetType,list:""});
			$("select[name='internetType']").html(html3);
			$('#myModal').modal({backdrop: 'static', keyboard: false});
			$(".modal-backdrop.fade.in").hide();//隐藏遮罩  
	}
  });
}
//把新增数据存入数据库
function add(){
if (validform().form()) {
	$(':button').attr('disabled',"true");
  var formData = $('#myform').serializeJSON();
  var data={
		  appCode:formData.appCode,
		  appName:formData.appName,
		  appType:formData.appType,
		  internetType:formData.internetType,
		  principal :formData.principal,
		  principalContact:formData.principalContact
	  }
  $.ajax({
	url: "/zhgl-jzstyxx-manage/application/AugmentApplication",
	type:"POST",
	data: data,
	dataType: 'json',
	success: function (data) {
		$(':button').removeAttr("disabled");
	  if (data.state==200) {
		   $('#myModal').modal('hide');
		   $('#tb_app').bootstrapTable('refresh');
		   zTree.reAsyncChildNodes(null,'refresh',false);
	   } else {
		   window.wxc.xcConfirm("保存失败！", window.wxc.xcConfirm.typeEnum.confirm,{
				title: "提示",
				btn: parseInt("0001",2), //确定按钮
			});
	    return 
	   }
	 }
  });
 }
} 
//修改模态框
function modify(){
   var rows=$("#tb_app").bootstrapTable("getSelections");
   if(rows.length==0){
		window.wxc.xcConfirm("请选择需要操作的数据！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		})
   }
   else if(rows.length>1){
	   window.wxc.xcConfirm("只能选择单条数据进行操作！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		});	
   }else{
		var id=rows[0].id;
	  	 $.ajax({
	       url:"/zhgl-jzstyxx-manage/application/getById",
	       type: 'post',
	       data:{"id":id},
	       dataType: 'json',
	       success: function (data) {
	          if (data.state==200) {
	              var tpl = document.getElementById('myFormTemplate').innerHTML;
	              var html = template(tpl, {app: data.data});
	              $("#myform2").html(html);
	              var tpl2 = document.getElementById('appTypeTemplate').innerHTML;
	              var html2 = template(tpl2, {app:appType,list:data.data});
	              $("select[name='appType']").html(html2);
	              var tpl3 = document.getElementById('internetTypeTemplate').innerHTML;
	              var html3 = template(tpl3, {app:internetType,list:data.data});
	              $("select[name='internetType']").html(html3);
	              $('#myModal2').modal({backdrop: 'static', keyboard: false});
	              $(".modal-backdrop.fade.in").hide();//隐藏遮罩
	            }else {
	            	window.wxc.xcConfirm("数据异常，请重试！", window.wxc.xcConfirm.typeEnum.confirm,{
						title: "提示",
						btn: parseInt("0001",2), //确定按钮
					});
	            }
	         }
	     });
   }
}
//修改后的数据保存
function save(){
if (validform2().form()) {
	$(':button').attr('disabled',"true");
	var formData = $('#myform2').serializeJSON();
	var data={
			id:formData.id,
			appCode:formData.appCode,
			appName:formData.appName,
			appType:formData.appType,
			internetType:formData.internetType,
			principal :formData.principal,
			principalContact:formData.principalContact
      }
      $.ajax({
        url: "/zhgl-jzstyxx-manage/application/save",
        type: 'post',
        data: data,
        dataType: 'json',
        success: function (data) {
        	console.log(data)
        	$(':button').removeAttr("disabled");
          if (data.state==200) {
        	  window.wxc.xcConfirm("保存成功！", window.wxc.xcConfirm.typeEnum.confirm,{
					title: "提示",
					btn: parseInt("0001",2), //确定按钮
					onOk: function(){
						$('#myModal2').modal('hide');
			            $('#tb_app').bootstrapTable('refresh');
			            zTree.reAsyncChildNodes(null,'refresh',false);
					}
				});
          } else {
        	  window.wxc.xcConfirm("保存失败！", window.wxc.xcConfirm.typeEnum.confirm,{
					title: "提示",
					btn: parseInt("0001",2), //确定按钮
				});
            return 
          }
        }
      });
    }
}
//弹出框重置
function empty(){
	 window.wxc.xcConfirm("确认重置吗？", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			onOk:  function(){
				document.getElementById("myform").reset();	
		}
	 })
}
//密钥重置
function keyreset(){
	var rows=$("#tb_app").bootstrapTable("getSelections");
	if(rows.length==0){
		window.wxc.xcConfirm("请选择需要重置的密钥！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		})
	}
	else if(rows.length>1){
		window.wxc.xcConfirm("只能选择单条数据进行操作！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		})
	}
	else{
		var id=rows[0].id;
		 window.wxc.xcConfirm("确定重置密钥？", window.wxc.xcConfirm.typeEnum.confirm,{
				title: "提示",
				onOk:  function(){
				  	  $.ajax({
				  	       url:"/zhgl-jzstyxx-manage/application/replacement",
				  	       data:{"id":id},
				  	       type: 'post',
				  	       dataType: 'json',
				  	       success: function (data) {
				  	         if (data.state==200) {
				  	        	 window.wxc.xcConfirm("重置成功！", window.wxc.xcConfirm.typeEnum.confirm,{
				  					title: "提示",
				  					btn: parseInt("0001",2), //确定按钮
				  					onOk: function(){
							            $('#tb_app').bootstrapTable('refresh');
									}
				  				});
				  	         }else if(data.state==110){
					            	window.wxc.xcConfirm(data.message, window.wxc.xcConfirm.typeEnum.confirm,{
						      			title: "提示",
						      			btn: parseInt("0001",2), //确定按钮
						      			onOk: function(){
						      				$('#tb_app').bootstrapTable('refresh');
										}
						          	  });
					            } else {
				  	        	 window.wxc.xcConfirm("数据异常，请重试！", window.wxc.xcConfirm.typeEnum.confirm,{
				  					title: "提示",
				  					btn: parseInt("0001",2), //确定按钮
				  				});
				  	         }
				  	      }
				  	    });
			}
		 })
	}
}
//查看服务密钥
function servicekey(e){
	var rows=$("#tb_app").bootstrapTable("getSelections");
	if(rows.length==0){
		window.wxc.xcConfirm("请选择需要重置的密钥！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		})
	}
	else if(rows.length>1){
		window.wxc.xcConfirm("只能选择单条数据进行操作！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		})
	}
	else{
		var id=rows[0].id;
		keyId=id;
         var tpl = document.getElementById('servicekeyTemplate').innerHTML;
         var html = template(tpl, {});
         $("#myform3").html(html);
         $('#myModal3').modal({backdrop: 'static', keyboard: false});
         $(".modal-backdrop.fade.in").hide();//隐藏遮罩
        }
}
//批量删除/删除
function delAll(){
  var rows=$("#tb_app").bootstrapTable("getSelections");
  if(rows.length==0){
	  window.wxc.xcConfirm("请选择你要删除的数据！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		});
  }else{
	  var ids="";
	  for(var i=0;i<rows.length;i++){
		ids+=rows[i].id+",";
	  }
	  ids=ids.substring(0,ids.length-1);
	  var data={
			  id:ids,
	  }
		 window.wxc.xcConfirm("确定删除所选记录吗", window.wxc.xcConfirm.typeEnum.confirm,{
				title: "提示",
				onOk:  function(){
				    $.ajax({
				        type: "POST",
				        url:"/zhgl-jzstyxx-manage/application/deleteAll",
				        dataType: 'json',
				        data:data,
				        success: function (data) {
				        	console.log(data)
				            if (data.state==200) {
				          	  window.wxc.xcConfirm("删除成功！", window.wxc.xcConfirm.typeEnum.confirm,{
				      			title: "提示",
				      			btn: parseInt("0001",2), //确定按钮
				      			onOk: function(){
						            $('#tb_app').bootstrapTable('refresh');
						            zTree.reAsyncChildNodes(null,'refresh',false);
								}
				          	  });
				            }else if(data.state==110){
				            	window.wxc.xcConfirm(data.message, window.wxc.xcConfirm.typeEnum.confirm,{
					      			title: "提示",
					      			btn: parseInt("0001",2), //确定按钮
					      			onOk: function(){
							            $('#tb_app').bootstrapTable('refresh');
							            zTree.reAsyncChildNodes(null,'refresh',false);
									}
					          	  });
				            }else {
				          	  window.wxc.xcConfirm("数据异常，请重试！", window.wxc.xcConfirm.typeEnum.confirm,{
				      			title: "提示",
				      			btn: parseInt("0001",2), //确定按钮
				      		});
				            }
				          }
				       });	
			}
		 })
  }
}
//服务密钥
function download(){
	window.location = "/zhgl-jzstyxx-manage/application/servicenetkey?id=" + keyId;
	
}
//队列密钥
function downloadKey(){
	window.location = "/zhgl-jzstyxx-manage/application/queuekey?id=" + keyId;
}
$(function(){
//树状图
//后台传入的tree列表
var zTreeNodes;
$.ajax({
 	url :"/zhgl-jzstyxx-manage/application/gettree",
 		type: 'post',
 		dataType:'json',
 		async: false,
 		success:function(data){
 			  //zTreeNodes=JSON.parse(data)  
 			 zTreeNodes=data
 			
 		}
 		});	

    var zTreeObj,
    setting = {
    	async:{
    		enable:true,
    		type:"post",
    		url:"/zhgl-jzstyxx-manage/application/gettree",
    	    contentType:"application/json",
    	    autoParam: ["id"], //异步加载数据，自动添加id参数，会自动获取当前节点的id值
    	},
        view: {
            //是否允许选中多个节点
            selectedMulti: false,
            //是否显示 连接线
            showLine:true
        },
		//数据
        data: {
            simpleData: {
                enable: true,
                idKey: "id",
                pIdKey: "pId",
                rootPId: "0"
            }
        },
		//是否使用复选框
        check:{
		//true / false 分别表示 显示 / 不显示 复选框或单选框
            enable: false,
			//chkStyle = "checkbox" 时，显示 checkbox 选择框,chkStyle = "radio" 时，显示 radio 选择框
            chkStyle: "checkbox",
			//Y 属性定义 checkbox 被勾选后的情况； 
			//N 属性定义 checkbox 取消勾选后的情况； 
			//"p" 表示操作会影响父级节点； 
			//"s" 表示操作会影响子级节点。
			
            chkboxType: { "Y": "ps", "N": "ps" }
        },
		//回调函数
        callback: {
		//点击时回调
            onClick: zTreeOnClick,
			//选中复选框时调用函数
            //onCheck: zTreeOnCheck,
			//onRightClick: OnRightClick
			
        }
    }
   
$(document).ready(function(){
	//初始化树形结构
	zTreeObj = $.fn.zTree.init($("#tree"), setting, zTreeNodes);
	zTree = $.fn.zTree.getZTreeObj("tree");
			/*rMenu = $("#rMenu");*/
	
});
})
    //tree点击时回调函数
function zTreeOnClick(event, treeId, treeNode) {
	$("#appTypes").val("");
	$("#ids").val("");
	if(treeNode.level==0){
		$("#appTypes").val(treeNode.id);
	}else if(treeNode.level==1){
		$("#ids").val(treeNode.id);
	}
		$('#tb_app').bootstrapTable('refreshOptions',{pageNumber:1});
		$('#tb_app').bootstrapTable('refresh');
}



function validform() {
     return $("#myform").validate({
         rules: {
         	appCode:{
                 required:true,
                 maxlength:16,
                 stringCheck:true
            },
             appName: {
                 required: true,
                 maxlength:32,
                 stringCheck:true,
                 remote:{
                	 url:"/zhgl-jzstyxx-manage/application/checkName",
                     type:"post",
                     dataType:"json",
                     async:false,
                     cache:false,
                     data:{
                    	 appName:function(){
                    		 var formData = $('#myform').serializeJSON();
                    		 return formData.appName;
                    	 	}
                     	},
            		dataFilter:function(data){
            				return data;
            		}
                 }
             },
             appType:{
            	 required: true
             },
             internetType:{
        	     required: true
             },
             principal: {
                 required: true,
                 maxlength:32,
                 stringCheck:true,
             },
             principalContact:{
                 required:true,
                 maxlength:11,
                 isMobile:true
           }
         },
		     messages: {
		     	appCode:{
		             required:"应用编码不能为空",
		             maxlength:"最多输入16位",
		             stringCheck:jQuery.validator.addMethod("stringCheck", function(value, element) {
		            	 var all= /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
		                 return this.optional(element) || all.test(value);       
		             }, "应用编码不能有特殊字符")
		        },
		         appName: {
		             required: "应用名称不能为空",
		             maxlength:"最多输入32位",
		             stringCheck:jQuery.validator.addMethod("stringCheck", function(value, element) {
		            	 var all= /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
		                 return this.optional(element) || all.test(value);       
		             }, "应用名称不能有特殊字符"),
		             remote:"应用名称已存在",
		        },
		         appType:{
		        	 required: "应用类型不能为空"
		         },
		         internetType:{
	        	  required: "所属网络不能为空"
	              },
		         principal: {
		             required: "负责人不能为空",
		             maxlength:"最多输入32位",
		             stringCheck:jQuery.validator.addMethod("stringCheck", function(value, element) {
		            	 var all= /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
		                 return this.optional(element) || all.test(value);       
		             }, "姓名不能有特殊字符")
		         },
		         principalContact:{
		             required:"联系方式不能为空",
		             maxlength:"最多输入11位",
		             isMobile:jQuery.validator.addMethod("isMobile", function(value, element) {
		            	 	var length = value.length;
		            	 	var mobile = /^((0\d{10})|(1[3584]\d{9}))$/;
		            	 	return this.optional(element) || (length == 11 && mobile.test(value));
		             		}, "请正确填写联系方式")
		       }
		 },
     })
 }
function validform2() {
    return $("#myform2").validate({
        rules: {
         	appCode:{
                 required:true,
                 maxlength:16,
                 stringCheck:true
            },
             appName: {
                 required: true,
                 maxlength:32,
                 stringCheck:true,
                 remote:{
                	 url:"/zhgl-jzstyxx-manage/application/checkAppName",
                     type:"post",
                     dataType:"json",
                     async:false,
                     cache:false,
                     data:{
                    	 appName:function(){
                    		 var formData = $('#myform2').serializeJSON();
                    		 return formData.appName;
                    	 	},
                    	 	id:function(){
                    		 var formData = $('#myform2').serializeJSON();
                    		 return formData.id;
                    	 	},
                     	},
            		dataFilter:function(data){
            			return data;
            		}
                 }
                 
             },
             appType:{
            	 required: true,
             },
             internetType:{
        	  required: true,
              },
             principal: {
                 required: true,
                 maxlength:32,
                 stringCheck:true,
             },
             principalContact:{
                 required:true,
                 maxlength:11,
                 isMobile:true,
           }
         },
		     messages: {
		     	appCode:{
		             required:"应用编码不能为空",
		             maxlength:"最多输入16位",
		             stringCheck:jQuery.validator.addMethod("stringCheck", function(value, element) {
		            	 var all= /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
		                 return this.optional(element) || all.test(value);       
		             }, "应用编码不能有特殊字符")
		        },
		         appName: {
		             required: "应用名称不能为空",
		             maxlength:"最多输入32位",
		             stringCheck:jQuery.validator.addMethod("stringCheck", function(value, element) {
		            	 var all= /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
		                 return this.optional(element) || all.test(value);       
		             }, "应用名称不能有特殊字符"),
		             remote:"应用名称已存在",
		             
		         },
		         appType:{
		        	 required: "应用类型不能为空",
		         },
			      internetType:{
	        	     required: "所属网络不能为空",
	             },
		         principal: {
		             required: "负责人不能为空",
		             maxlength:"最多输入32位",
		             // 字符验证，只能包含中文、英文、数字、下划线等字符。    
		             stringCheck:jQuery.validator.addMethod("stringCheck", function(value, element) {
		            	 var all= /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
		                 return this.optional(element) || all.test(value);       
		             }, "名称不能有特殊字符")
		         },
		         principalContact:{
		             required:"联系方式不能为空",
		             maxlength:"最多输入11位",
		             isMobile:jQuery.validator.addMethod("isMobile", function(value, element) {
		            	 	var length = value.length;
		            	 	var mobile = /^((0\d{10})|(1[3584]\d{9}))$/;
		            	 	return this.optional(element) || (length == 11 && mobile.test(value));
		             		}, "请正确填写联系方式")
		       }
		 },
   })
}















//保存队列源应用到session
function saveOriginApp() {
	console.log("保存源应用");
	var arr = $('#tb_app').bootstrapTable('getSelections');
	if (arr.length == 0) {
		window.wxc.xcConfirm("请选择需要操作的数据！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		});
	} else if(arr.length > 1) {
		window.wxc.xcConfirm("只能选择单条数据进行操作！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		});
	} else if(arr.length == 1){
//		console.log("选中的数据: ",arr[0]);
		var originId = arr[0].id;
		var originName = arr[0].appName;
//		console.log("originId: "+ originId + ",  originName: " + originName);
     var option = {
			title: "提示",
			btn: parseInt("0011",2),
			onOk: function(){
				var url = "/zhgl-jzstyxx-manage/queueAccess/saveOriApp";
				var datapost = {
					"originId" : originId,
					"originName" : originName,
					"key" : key
				}
				$.post(url, datapost, function(key) {
					window.location = "/zhgl-jzstyxx-manage/queueAccess/page?key=" + key;
				});
				
			}
		}
		window.wxc.xcConfirm("是否保存此源应用？", "custom", option);
	}
}

//保存队列目标应用到session
function saveTargetApp() {
	var arr = $('#tb_app').bootstrapTable('getSelections');
	if (arr.length == 0) {
		window.wxc.xcConfirm("请选择需要操作的数据！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		});
	} else if(arr.length > 1) {
		window.wxc.xcConfirm("只能选择单条数据进行操作！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		});
	} else if(arr.length == 1){
//		console.log("选中的数据: ",arr[0]);
		var targetId = arr[0].id;
		var targetName = arr[0].appName;
     var option = {
			title: "提示",
			btn: parseInt("0011",2),
			onOk: function(){
				var url = "/zhgl-jzstyxx-manage/queueAccess/saveTApp";
				var datapost = {
					"targetId" : targetId,
					"targetName" : targetName,
					"index" : index,	//目标应用下标
					/*"tarId" : tarId,*/	//目标应用id
					"key" : key
				}
				$.post(url, datapost, function(result) {
					console.log("返回数据: ", result);
					var state = result.state;
					if(state === 200 ) {
						window.location = "/zhgl-jzstyxx-manage/queueAccess/page?key=" + key;
					}
					else {	//400
						window.wxc.xcConfirm("该应用已被选为目标应用，请更换其他应用操作！", window.wxc.xcConfirm.typeEnum.confirm,{
							title: "提示",
							btn: parseInt("0001",2), //确定按钮
						});
						return;
					}
//					console.log("获取的session中数据: ", map);
//					window.location = "/zhgl-jzstyxx-manage/queueAccess/page?key=" + key;
				});
			}
		}
		window.wxc.xcConfirm("是否保存此目标应用？", "custom", option);
	}
}


//取消操作返回
function cancel() {
	window.location = "/zhgl-jzstyxx-manage/queueAccess/page?key=" + key;
}




//服务接入保存源应用
function saveUnprocessedApp() {
	console.log("保存源应用");
	var arr = $('#tb_app').bootstrapTable('getSelections');
	if (arr.length == 0) {
		window.wxc.xcConfirm("请选择需要操作的数据！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		});
	} else if(arr.length > 1) {
		window.wxc.xcConfirm("只能选择单条数据进行操作！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		});
	} else if(arr.length == 1){
//		console.log("选中的数据: ",arr[0]);
		var originId = arr[0].id;
		var originName = arr[0].appName;
//		console.log("originId: "+ originId + ",  originName: " + originName);
     var option = {
			title: "提示",
			btn: parseInt("0011",2),
			onOk: function(){
				var url = "/zhgl-jzstyxx-manage/serviceAccess/saveOriApp";
				var datapost = {
					"originId" : originId,
					"originName" : originName,
					"key" : key
				}
				$.post(url, datapost, function() {
					window.location = "/zhgl-jzstyxx-manage/serviceAccess/page?key=" + key;
				});
				
			}
		}
		window.wxc.xcConfirm("是否保存此源应用？", "custom", option);
	}
}

//取消操作返回
function cancel1() {
//	window.location = "/queueAccess/page";
	//history.go(-1);
	window.location = "/zhgl-jzstyxx-manage/serviceAccess/page?key=" + key;
}
//服务接入保存目标应用
function saveTargetAppOne() {
	var arr = $('#tb_app').bootstrapTable('getSelections');
	if (arr.length == 0) {
		window.wxc.xcConfirm("请选择需要操作的数据！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		});
	} else if(arr.length > 1) {
		window.wxc.xcConfirm("只能选择单条数据进行操作！", window.wxc.xcConfirm.typeEnum.confirm,{
			title: "提示",
			btn: parseInt("0001",2), //确定按钮
		});
	} else if(arr.length == 1){
//		console.log("选中的数据: ",arr[0]);
		var targetId = arr[0].id;
		var targetName = arr[0].appName;
//		console.log("originId: "+ originId + ",  originName: " + originName);
     var option = {
			title: "提示",
			btn: parseInt("0011",2),
			onOk: function(){
				var url = "/zhgl-jzstyxx-manage/serviceAccess/saveTargetApp";
				var datapost = {
					"targetId" : targetId,
					"targetName" : targetName,
					"key" : key,
					"index" : num
				}
				$.post(url, datapost, function(data) {
					if(data=="false"){
						window.wxc.xcConfirm("该应用在主题队列中已存在，请选择其他应用", window.wxc.xcConfirm.typeEnum.confirm,{
							title: "提示",
							btn: parseInt("0001",2), //确定按钮
						});
					}else{
						window.location = "/zhgl-jzstyxx-manage/serviceAccess/page?key=" + key;
					}
				});
				
			}
		}
		window.wxc.xcConfirm("是否保存此目标应用？", "custom", option);
	}
}

